import React, { FC } from "react"
import { Link } from "react-router-dom"
import { LOGIN_PATHNAME } from "../router"
import { getUserInfoService } from "../services/user"
import { useRequest } from "ahooks"
import { UserOutlined } from "@ant-design/icons"

const UserInfo: FC = () => {
  const { data } = useRequest(getUserInfoService)
  const { username, nickname } = data || {}

  const UserInfo = (
    <>
      <span style={{ color: "#e8e8e8" }}>
        <UserOutlined></UserOutlined>
        {nickname}
      </span>
      <Button></Button>
    </>
  )

  return (
    <>
      <Link to={LOGIN_PATHNAME}>登录</Link>
    </>
  )
}
export default UserInfo
